import login from './pages/login'
import DashBoard from './pages/DashBoard';

import MainPage from './components/MainPage';
import CentralKitchenManage from './components/CooperationManager/CentralKitchenManage';
import StoreAdd from './components/CooperationManager/AddStore';
import StoreEdit from './components/CooperationManager/EditStore';
import OrderManage from './components/OperationManager/OrderManage';
import MenuManage from './components/OperationManager/MenuManage';
import MenuAdd from './components/OperationManager/AddMenu';
/*import RegisterNav from './pages/Register/register';*/
//配置管理
import Register from './pages/Register/register';

import GoodsCategoryIndex from './components/configManage/goodsCategoryIndex';
import GoodsCategory from './components/configManage/goodsCategory';
import GoodsCategoryAdd from './components/configManage/goodsCategoryAdd';
import GoodsCategoryEdit from './components/configManage/goodsCategoryEdit';
import GoodsCategoryChild from './components/configManage/goodsCategoryChild';


import ArticlesIndex from './pages/articles/index'
import Articles from './pages/articles/articles'
import ArticlesEdit from './pages/articles/edit'

import UsersIndex from './pages/users/index'
import Users from './pages/users/users'


const routes = [
    {
        path:'/',
        component:login
    },
    {
        path:'/login',
        name:'login',
        component:login
    },
    {
        path: '/register',
        component: Register,
    },
    {
        path:'/dashboard',
        meta:{title:'首页'},
        component:DashBoard,
        children: [
            {
                path: '/',
                component: MainPage,
            },
            {
                path: 'mainPage',
                component: MainPage,
            },
            {
                path: 'articles',
                component: ArticlesIndex,
                meta: { title: '博文' },
                children:[
                    {
                        path: '',
                        meta: { title: '博文列表' },
                        component: Articles,
                    },
                    {
                        path: 'add',
                        meta: { title: '添加博文' ,type:1},
                        component: ArticlesEdit,
                    },
                    {
                        path: 'edit/:id?',
                        meta: { title: '编辑博文' ,type:2},
                        component: ArticlesEdit,
                    }
                ]
            },
            {
                path: 'users',
                component: UsersIndex,
                meta: { title: '用户' },
                children:[
                    {
                        path: '',
                        meta: { title: '用户列表' },
                        component: Users,
                    },
                ]
            },
            {
                path: 'cooperationManger/centralKitchenManage',
                name: 'centralKitchenManage',
                meta: { title: '中央厨房管理' },
                component: CentralKitchenManage,
            },
            {
                path: 'cooperationManger/centralKitchenManage/add',
                name: 'StoreAdd',
                meta: { title: '中央厨房添加' },
                component: StoreAdd,
            },
            {
                path: 'cooperationManger/centralKitchenManage/edit/:vendorId',
                name: 'StoreEdit',
                meta: { title: '中央厨房编辑' },
                component: StoreEdit,
            },
            {
                path: 'operationManger/orderManage',
                meta: { title: '订单管理' },
                component: OrderManage,
            },
            {
                path: 'operationManger/menuManage',
                component: MenuManage,
            },
            {
                path: 'operationManger/menuManage/add',
                component: MenuAdd,
            },
            //配置管理/商品分类
            {
                path: 'configManage/goodsCategory',
                meta: { title: '商品分类' },
                component: GoodsCategoryIndex,
                children:[
                    {
                        path: '',
                        name: 'goodsCategory',
                        meta: { title: '商品分类' },
                        component: GoodsCategory,
                    },
                    {
                        path: 'add/:id',
                        name: 'goodsCategoryAdd',
                        meta: { title: '分类添加' },
                        component: GoodsCategoryAdd,
                    },
                    {
                        path: 'edit/:id',
                        name: 'goodsCategoryEdit',
                        meta: { title: '分类编辑' },
                        component: GoodsCategoryEdit,
                    },
                    {
                        path: 'child/:id',
                        name: 'goodsCategoryChild',
                        meta: { title: '子分类列表' },
                        component: GoodsCategoryChild,
                    },
                ],
            },

            {
                path:'systemManager/directiveSet',
                meta:{title:'指令集管理'},
                component: () => import('./components/systemManager/directiveSet/directiveSetIndex'),
                children:[
                    {
                        path:'',
                        component: () => import('./components/systemManager/directiveSet/directiveSet'),
                        meta:{title:'指令集管理'}
                    },
                    {
                        path:'add',
                        component:() => import('./components/systemManager/directiveSet/directiveSetAdd'),
                        meta:{title:'指令集添加'}
                    },
                    {
                        path:'edit/:id',
                        component:() => import('./components/systemManager/directiveSet/directiveSetEdit'),
                        meta:{title:'指令集编辑'}
                    },
                ]
            },
        ],
    }
];
export default routes;
